<?php

require '../utils/conn.php';
include_once '../models/recommand.php';
include_once 'getSet.php';

function getRecommandSets($rid) {

	$query = "SELECT * FROM t_recommand_set WHERE r_id=".$rid;
	
	$sets = array();
	$result = mysql_query($query) or die("错误：". mysql_error());;
	while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
	{
		$set = getSetById($row['s_id']);
		$set->isImportant = $row['remark'];
		$sets[] = $set;
	}
	return $sets;
}

function getRecommandBaseSets($rid) {

	$query = "SELECT * FROM t_recommand_set WHERE r_id=".$rid;
	
	$sets = array();
	$result = mysql_query($query) or die("错误：". mysql_error());;
	while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
	{
		$set = getSetBaseInfoById($row['s_id']);
		$set->isImportant = $row['remark'];
		$sets[] = $set;
	}
	return $sets;
}

?>